import { useRequest } from '@/hooks';
import { getInterviewCompanyInfo } from '../service/interview';

const useCompanyName = id =>
    useRequest(() => getInterviewCompanyInfo(id), {
        initialData: '',
        formatResult: res => {
            if (res) {
                const { code, data } = res;
                if (code === 10000) {
                    return data?.companyName || '';
                }
            }
            return '';
        }
    });

export default useCompanyName;
